package com.bwie.app;

import android.app.Application;
import android.content.Context;
import android.os.Handler;
import android.os.Process;

import org.xutils.x;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by PC on 2016/10/31.
 */
public class MyApplication extends Application{

    private static Context context;
    private static Handler handler;

    private static Thread thread;
    private static ExecutorService executorService;
    private static int myTid;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        handler = new Handler();
        myTid = Process.myTid();
        thread = Thread.currentThread();
        executorService = Executors.newFixedThreadPool(5);
        x.Ext.init(this);
        x.Ext.setDebug(true);
    }
    public static Context getContext(){
        return context;
    }
    public static Handler getHandler()
    {
        return handler;
    }
    public static int getMyTid()
    {
        return myTid;
    }
    public static Thread getThread()
    {
        return thread;
    }
    public static ExecutorService getExecutorService()
    {
        return executorService;
    }
}
